<!-- Index.html file to dynamically list on github pages Soot's jdoc and options  for all versions  -->
<!-- the index approach is adapted from https://stackoverflow.com/questions/39048654/how-to-enable-directory-indexing-on-github-pages -->
<!-- content url https://api.github.com/repos/soot-oss/soot/contents/docs?ref=gh-pages -->
<html>
  <body>
    <script>
      (async () => {
        const response = await fetch('https://api.github.com/repos/soot-oss/soot/contents/docs?ref=gh-pages');
        const data = await response.json();
        let htmlString = '<h1>Soot Documentation</h1>';
        htmlString += '<ul>'
        for (let file of data) {
          // do not create an index for html or css files
          if(file.name.endsWith('.html') || file.name.endsWith('.css') ){
            continue
          }
          htmlString += `<li>`
          htmlString += `<h5>>${file.name}</h5>`
          // create direct links to jdoc and options
          htmlString += `<ul>`
          htmlString += `<li><a href="${file.name}/options/soot_options.html">Soot Options</a></li>`;
          htmlString += `<li><a href="${file.name}/jdoc/index.html">JavaDoc</a></li>`;
          htmlString += `</ul>`
          htmlString += `</li>`
        }
        htmlString += '</ul>';
        document.getElementsByTagName('body')[0].innerHTML = htmlString;
      })()
    </script>
  <body>
</html>